package org.grayrabbit.cms.entity;

// Generated 2011-5-16 13:39:30 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsVote generated by hbm2java
 */
@Entity
@Table(name = "CMS_VOTE")
public class Vote implements java.io.Serializable {

	private static final long serialVersionUID = 1801668825720600482L;
	private String voteId;
	private String voteTitle;
	private Boolean voteStatus;
	private Boolean voteRepeatSubmit;
	private Boolean voteCheckType;
	private String voteIpForbidden;
	private String voteMacForbidden;
	private String createRealName;
	private String createLoginName;
	private String updateLoginName;
	private String updateRealName;
	private Date createTime;
	private Date updateTime;
	private Date endTime;
	private Date startTime;
	private Integer joinTotal;
	private Integer intervalTime;
	private Site site;
	private Integer ord;
	private String describe;//描述
	private Boolean interviewee;//受访人群
	private Boolean isComment;//是否允许评论

	private Set<VoteRecord> voteRecords = new HashSet<VoteRecord>(0);
	private Set<VoteOption> voteOptions = new HashSet<VoteOption>(0);

	public Vote() {
	}

	public Vote(String voteId) {
		this.voteId = voteId;
	}

	@Id
	@Column(name = "VOTE_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getVoteId() {
		return this.voteId;
	}

	public void setVoteId(String voteId) {
		this.voteId = voteId;
	}

	@Column(name = "VOTE_TITLE", length = 64)
	public String getVoteTitle() {
		return this.voteTitle;
	}

	public void setVoteTitle(String voteTitle) {
		this.voteTitle = voteTitle;
	}

	@Column(name = "VOTE_STATUS", precision = 1, scale = 0)
	public Boolean getVoteStatus() {
		return this.voteStatus;
	}

	public void setVoteStatus(Boolean voteStatus) {
		this.voteStatus = voteStatus;
	}

	@Column(name = "VOTE_REPEAT_SUBMIT", precision = 1, scale = 0)
	public Boolean getVoteRepeatSubmit() {
		return this.voteRepeatSubmit;
	}

	public void setVoteRepeatSubmit(Boolean voteRepeatSubmit) {
		this.voteRepeatSubmit = voteRepeatSubmit;
	}

	@Column(name = "VOTE_CHECK_TYPE", precision = 1, scale = 0)
	public Boolean getVoteCheckType() {
		return this.voteCheckType;
	}

	public void setVoteCheckType(Boolean voteCheckType) {
		this.voteCheckType = voteCheckType;
	}

	@Column(name = "VOTE_IP_FORBIDDEN", length = 4000)
	public String getVoteIpForbidden() {
		return this.voteIpForbidden;
	}

	public void setVoteIpForbidden(String voteIpForbidden) {
		this.voteIpForbidden = voteIpForbidden;
	}

	@Column(name = "VOTE_MAC_FORBIDDEN", length = 256)
	public String getVoteMacForbidden() {
		return this.voteMacForbidden;
	}

	public void setVoteMacForbidden(String voteMacForbidden) {
		this.voteMacForbidden = voteMacForbidden;
	}

	@Column(name = "CREATE_REAL_NAME", length = 64)
	public String getCreateRealName() {
		return this.createRealName;
	}

	public void setCreateRealName(String createRealName) {
		this.createRealName = createRealName;
	}

	@Column(name = "CREATE_LOGIN_NAME", length = 64)
	public String getCreateLoginName() {
		return this.createLoginName;
	}

	public void setCreateLoginName(String createLoginName) {
		this.createLoginName = createLoginName;
	}

	@Column(name = "UPDATE_LOGIN_NAME", length = 64)
	public String getUpdateLoginName() {
		return this.updateLoginName;
	}

	public void setUpdateLoginName(String updateLoginName) {
		this.updateLoginName = updateLoginName;
	}

	@Column(name = "UPDATE_REAL_NAME", length = 64)
	public String getUpdateRealName() {
		return this.updateRealName;
	}

	public void setUpdateRealName(String updateRealName) {
		this.updateRealName = updateRealName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", length = 7)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATE_TIME", length = 7)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "END_TIME", length = 7)
	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "START_TIME", length = 7)
	public Date getStartTime() {
		return this.startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Column(name = "JOIN_TOTAL", precision = 6, scale = 0)
	public Integer getJoinTotal() {
		return this.joinTotal;
	}

	public void setJoinTotal(Integer joinTotal) {
		this.joinTotal = joinTotal;
	}

	@Column(name = "INTERVAL_TIME", precision = 6, scale = 0)
	public Integer getIntervalTime() {
		return this.intervalTime;
	}

	public void setIntervalTime(Integer intervalTime) {
		this.intervalTime = intervalTime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "vote")
	public Set<VoteRecord> getVoteRecords() {
		return voteRecords;
	}

	public void setVoteRecords(Set<VoteRecord> voteRecords) {
		this.voteRecords = voteRecords;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "vote")
	public Set<VoteOption> getVoteOptions() {
		return voteOptions;
	}

	public void setVoteOptions(Set<VoteOption> voteOptions) {
		this.voteOptions = voteOptions;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SITE_ID")
	public Site getSite() {
		return site;
	}

	public void setSite(Site site) {
		this.site = site;
	}

	@Column(name = "ORD", precision = 6, scale = 0)
	public Integer getOrd() {
		return ord;
	}

	public void setOrd(Integer ord) {
		this.ord = ord;
	}
	
	@Column(name = "DESCRIBE", length = 256)
	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}
	@Column(name = "IS_COMMENT", precision = 1, scale = 0)
	public Boolean getIsComment() {
		return isComment;
	}

	public void setIsComment(Boolean isComment) {
		this.isComment = isComment;
	}

	@Column(name = "INTERVIEWEE", precision = 1, scale = 0)
	public Boolean getInterviewee() {
		return interviewee;
	}

	public void setInterviewee(Boolean interviewee) {
		this.interviewee = interviewee;
	}
}
